package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.ContractOrderMapper;
import com.ly.heart.service.IContractOrderService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.ContractOrderEntity;

import javax.annotation.Resource;

/**
 * 合同-订单相互关联Service业务层处理
 *
 * @author wutao
 * @date 2024-06-17
 */
@Service
public class ContractOrderServiceImpl extends ServiceImpl<ContractOrderMapper, ContractOrderEntity> implements IContractOrderService {

    @Resource
    private ContractOrderMapper contractOrderMapper;

    /**
     * 查询合同-订单相互关联
     *
     * @param id 合同-订单相互关联ID
     * @return 合同-订单相互关联
     */
    @Override
    public ContractOrderEntity selectContractOrderEntityById ( String id ) {
        return contractOrderMapper.selectContractOrderEntityById ( id );
    }

    /**
     * 查询合同-订单相互关联列表
     *
     * @param contractOrderEntity 合同-订单相互关联
     * @return 合同-订单相互关联
     */
    @Override
    public List<ContractOrderEntity> selectContractOrderEntityList ( ContractOrderEntity contractOrderEntity ) {
        return contractOrderMapper.selectContractOrderEntityList ( contractOrderEntity );
    }

    /**
     * 新增合同-订单相互关联
     *
     * @param contractOrderEntity 合同-订单相互关联
     * @return 结果
     */
    @Override
    public int insertContractOrderEntity ( ContractOrderEntity contractOrderEntity ) {
        contractOrderEntity.setCreateTime ( DateUtils.getNowDate () );
        return contractOrderMapper.insertContractOrderEntity ( contractOrderEntity );
    }

    /**
     * 修改合同-订单相互关联
     *
     * @param contractOrderEntity 合同-订单相互关联
     * @return 结果
     */
    @Override
    public int updateContractOrderEntity ( ContractOrderEntity contractOrderEntity ) {
        contractOrderEntity.setUpdateTime ( DateUtils.getNowDate () );
        return contractOrderMapper.updateContractOrderEntity ( contractOrderEntity );
    }

    /**
     * 批量删除合同-订单相互关联
     *
     * @param ids 需要删除的合同-订单相互关联ID
     * @return 结果
     */
    @Override
    public int deleteContractOrderEntityByIds ( String[] ids ) {
        return contractOrderMapper.deleteContractOrderEntityByIds ( ids );
    }

    /**
     * 删除合同-订单相互关联信息
     *
     * @param id 合同-订单相互关联ID
     * @return 结果
     */
    @Override
    public int deleteContractOrderEntityById ( String id ) {
        return contractOrderMapper.deleteContractOrderEntityById ( id );
    }
}
